package com.cityfood.common.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ProductNoUtil {
	
	 private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");

	    /**
	     * 生成商品编号
	     *
	     * @param No 商品号前缀
	     * @return
	     */
	    public static String getProductNo() {
	        //生成订单编号
	        String productNo = "No" + sdf.format(new Date()) + (1 + (int) (Math.random() * 900 + 100));
	        return productNo;
	    }
	public static void main(String[] args) {
		System.out.println(getProductNo());
	}

}
